<template>
  <div :class="isShow ? ' content' : 'app content'">
    <div class="con" v-for="(item, i) in arr" :key="i">
      {{ item }}
    </div>

    <div class="close_btn" @click="closeT">
      <div class="sl" v-if="!isShow">...... ......</div>
      {{ msg }}
    </div>
  </div>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      arr: [
        "ssssssssssssssssssssss",
        "dddddddddddddddddddddddddddd",
        "ccccccccccccccccccccccccc",
        "nnnnnnnnnnnnnnnn",
      ],
      isShow: true,
      msg: "收起",
    };
  },
  mounted() {},
  methods: {
    closeT() {
      if (this.isShow) {
        this.isShow = false;
        this.msg = "展开";
      } else {
        this.isShow = true;
        this.msg = "收起";
      }
    },
  },
};
</script>

<style lang='scss' scoped>
.content {
  position: relative;
  font-size: 20px;
  background: #ccc;
  padding-bottom: 50px;
}
.app {
  height: 40px;
}
.close_btn {
  position: absolute;
  bottom: 0;
  background: #ccc;
  height: 50px;
  text-align: center;
  line-height: 50px;
  width: 100%;
}
.sl {
  position: absolute;
  top: 0;
  left: 0;
  line-height: 20px;
}
</style>
